//
//  STDaySelCell.m
//  YiYueStore
//
//  Created by zhouzhouzhou on 2018/10/16.
//  Copyright © 2018年 YuYiLian. All rights reserved.
//

#import "STDaySelCell.h"

#import "WBPopMenuModel.h"
#import "WBPopMenuSingleton.h"

@implementation STDaySelCell


-(void)setDaySelWithInfo:(NSDictionary *)dayInfo{
    self.fromBtn.layer.borderColor = [UIColor grayColor].CGColor;
    self.endBtn.layer.borderColor = [UIColor grayColor].CGColor;
    self.fromBtn.layer.borderWidth = 1;
    self.endBtn.layer.borderWidth = 1;
    self.typeBtn.layer.borderColor = [UIColor grayColor].CGColor;
    self.typeBtn.layer.borderWidth = 1;
    
    [self.typeBtn addTarget:self action:@selector(actionShoeOtherSel:) forControlEvents:UIControlEventTouchUpInside];
}

-(void)actionShoeOtherSel:(UIButton *)sender{
    NSMutableArray * obj = [NSMutableArray arrayWithCapacity:3];
    NSArray* arr = @[@"全部",@"入驻美发师",@"签约美发师"];
    for (NSInteger i = 0; i < arr.count; i++) {
        
        WBPopMenuModel *info = [[WBPopMenuModel alloc] init];
        info.title = arr[i];
        [obj addObject:info];
    }
    
    WBPopMenuSingleton * menuView = [WBPopMenuSingleton shareManager];
    menuView.setTableFrame = YES;
    menuView.popMenuFrame = CGRectMake(self.typeBtn.origin.x, self.typeBtn.origin.y+64+44*4+10, self.typeBtn.size.width,  90);
//    menuView.popMenuShowView = [UIWindow keywin];
    WeakSelf
    menuView.popMenuType = WBPopMenuFromTop;
    [menuView
     showPopMenuSelecteWithFrame:self.typeBtn.size.width
     item:obj
     viewController:[ZYHCommonMethod getCurrentRootViewController:self]
     action:^(NSInteger index) {
//         NSLog(@"index:%ld", (long)index);
         NSString * type = arr[index];
         weakSelf.selectHairType((int)index);
         weakSelf.typeBtn.titleLabel.text = type;
         [weakSelf.typeBtn setTitle:type forState:UIControlStateNormal];
     }];
}

- (IBAction)actionSureBtn:(id)sender {
}


@end
